package com.jbm.onehome.iface;

import com.jbm.core.iface.IAcross;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;

/**
 * Created by lyh on 2017-05-19.
 */
@Entity
@Table(name = "enchashment", schema = "", catalog = "")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
public class EnchashmentEntity extends IAcross {
@Transient
    public int start=0;
@Transient
    public int pagesize=0;
    private int id;
    private Integer accId;
    private String accType;
    private String paytype;
    private BigDecimal amount;
    private Integer status;
    private Timestamp createDate;
    private Integer paybackid;
    private PaybackEntity paybackEntity;

    private String applyname;
    private String applymobile;


    public EnchashmentEntity()
    {
        super();
    }


    public EnchashmentEntity(IAcross ia)
    {
        super(ia);
    }

    public  EnchashmentEntity(BigDecimal amount,String paytype)
    {
        this.amount=amount;
        this.paytype=paytype;
    }

    public  EnchashmentEntity(Integer status)
    {
        this.status=status;
    }

    @Id
    @Column(name = "id")
    @GeneratedValue
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "acc_id", nullable = true,  updatable = true)
    public Integer getAccId() {
        return accId;
    }

    public void setAccId(Integer accId) {
        this.accId = accId;
    }

    @Basic
    @Column(name = "acc_type", nullable = true,  updatable = true, length = 45)
    public String getAccType() {
        return accType;
    }

    public void setAccType(String accType) {
        this.accType = accType;
    }

    @Basic
    @Column(name = "paytype", nullable = true,  updatable = true, length = 45)
    public String getPaytype() {
        return paytype;
    }

    public void setPaytype(String paytype) {
        this.paytype = paytype;
    }

    @Basic
    @Column(name = "amount", nullable = true,  updatable = true, precision = 2)
    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    @Basic
    @Column(name = "status", nullable = true,  updatable = true)
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Basic
    @Column(name = "create_date", nullable = true,  updatable = true)
    public Timestamp getCreateDate() {
        return createDate;
    }

        public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }
@Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        EnchashmentEntity that = (EnchashmentEntity) o;

        if (id != that.id) return false;
        if (accId != null ? !accId.equals(that.accId) : that.accId != null) return false;
        if (accType != null ? !accType.equals(that.accType) : that.accType != null) return false;
        if (amount != null ? !amount.equals(that.amount) : that.amount != null) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (paytype != null ? !paytype.equals(that.paytype) : that.paytype != null) return false;
        if (status != null ? !status.equals(that.status) : that.status != null) return false;

        return true;
    }

@Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (accId != null ? accId.hashCode() : 0);
        result = 31 * result + (accType != null ? accType.hashCode() : 0);
        result = 31 * result + (paytype != null ? paytype.hashCode() : 0);
        result = 31 * result + (amount != null ? amount.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "paybackid", nullable = true,  updatable = true)
    public Integer getPaybackid() {
        return paybackid;
    }

    public void setPaybackid(Integer paybackid) {
        this.paybackid = paybackid;
    }

    @Transient
    public PaybackEntity getPaybackEntity() {
        return paybackEntity;
    }

    public void setPaybackEntity(PaybackEntity paybackEntity) {
        this.paybackEntity = paybackEntity;
    }

    @Transient
    public String getApplyname() {
        return applyname;
    }

    public void setApplyname(String applyname) {
        this.applyname = applyname;
    }

    @Transient
    public String getApplymobile() {
        return applymobile;
    }

    public void setApplymobile(String applymobile) {
        this.applymobile = applymobile;
    }
}
